import { CourseId, XBusinesslineId } from '..'

/**
 *礼品卡信息
 */
export type PrepaidCardInfo = {
  app_id: number //100
  bind_time: string //'2023-02-13 10:13:54'
  card_balance: string //'4197.00'
  card_balance_amount: number // 419700
  card_denomination: string //'5000'
  card_number: string //'XESH1000130C10766666'
  current_status: number //10
  expiration_date_desc: string // '2022-07-06至2023-08-02'
}

/**礼品卡总返回值 */
export type PrepaidCardResponse = {
  data: ResPrepaidCard
  msg: string //success
  status: number //1
  trace_id: string //dayu_7df4c7fd994913a5aeb49abdb2967abd
}
/**礼品卡返回数据 */
export type ResPrepaidCard = { list: Array<PrepaidCardInfo>; binding_card_jump_url: string }
/**礼品卡请求参数 */
export type PrepaidCardParam = {
  course_id: CourseId
  'X-Businessline-Id': XBusinesslineId
}
/**礼品卡 */
export type couponPromInfo = {
  cash_coupon_reduced_money: string //'0'
  checked_cash_coupon_num: number //0
  checked_order_coupon_num: number // 1
  checked_product_coupon_num: number // 0
  coupon_detail: Array<{
    promotion_type: number // 1201
    coupon_name: string // '测试奖学金订单类'
    reduced_money: string //'9'
  }>
  order_coupon_reduced_money: string // '9'
  product_coupon_reduced_money: number // 0
  reduced_money: number // 9
  rule_url: string //'https://t.bcc.xiwang.com/Rz5xdYSy'
  total_discount: number // 9
}
/**
 * 选择礼品卡更新价格
 */
export type CardUpdatePriceInfo = {
  allPromoPrice: string //'-¥0'
  couponInfo: {
    isChecked: 0
    couponTxt: string //'无可用'
    couponPrice: 0
    couponPriceStr: string //'0'
    choose_coupon: []
  }
  couponProm: couponPromInfo
  prepaidReduced: string //'715.00'
  realPayMoney: 0
  realPayPrice: string //'¥0.00'
  realPayPriceNum: string // '0.00'
}

/**选择更新价格参数 */
export type SelectCardUpdatePriceParam = {
  product_info: string //'W3sicHJvZHVjdF9pZCI6IjEzOTQ1NTUiLCJwcmljZSI6IjcxNSIsInByb2R1Y3RfbnVtIjoxLCJicmFuZCI6IjEwMCJ9XQ==' //[{"product_id":"1394555","price":"715","product_num":1,"brand":"100"}]
  use_gold: string //'1'
  choose_prepaid_cards?: Array<{
    card_number?: string // 'XESH1000130C10766666'
    card_balance_amount?: string //'419700'
    user_coupon_id?: string // 2M3Q443CBY4SE4MBXH88
  }>
  choose_user_coupons?: Array<{ user_coupon_id?: string }>
  balance: string // '0'
  'X-Businessline-Id': XBusinesslineId // '30'
}

/**选择更新价格返回 */
export type SelectCardUpdatePriceResponse = {
  result: { data: CardUpdatePriceInfo; status: number }
}
